<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-6" id="inventoryLeftDiv">
            <div class="content-wrap" id="leftCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugInventoryCheck/recordIndex')">药品列表</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="drugInventoryCheck"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugInventoryCheck/recordIndex');" method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                            <div class="form-group">
                                                <label>药品名称:</label>
                                                <form:input path="drugName" htmlEscape="false" maxlength="50" class="form-control"/>
                                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                            </div>

                                        </form:form>
                                    </div>
                                </div>
                                <div class="container-fluid">
                                    <table id="contentTable" class="table table-bordered mg-t datatable">
                                        <thead>
                                        <tr>
                                            <th>药品名称</th>
                                            <th>包装规格</th>
                                            <th>包装单位</th>
                                            <th>药品厂商</th>

                                            <th>大包装总数</th>
                                            <th>小包装总数</th>
                                            <th>本月最新盘点时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <c:forEach items="${page.list}" var="drugStock">
                                        <tr onclick="detail('${drugStock.id}','${drugStock.storageId}')">
                                            <td> ${drugStock.drugNames}</td>
                                            <td> ${drugStock.packageSpec}</td>
                                            <td> ${fns:getDictLabels(drugStock.packageUnits, 'SPEC_UNIT', '')}</td>
                                            <td> ${drugStock.supplierJcs}</td>

                                            <td> ${drugStock.quantity/drugStock.packageNum}</td>
                                            <td> ${drugStock.quantity}</td>
                                            <td><fmt:formatDate value="${drugStock.createDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate> </td>
                                        </tr>
                                        </c:forEach>
                                    </table>
                                    <div class="pagination">${page}</div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <%--右侧药品规格字典列表--%>
        <section class="main-content col-lg-6">
            <div class="content-wrap" id="rigthCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#" >盘点药品明细列表</a>
                        </li>
                    </ul>
                </div>
            </div>
        </section>
    </section>
    </section>
</div>
<script>

   function detail(Infoid,storageId){

      loadDiv('rigthCenterDiv','${ctx}/drug/drugInventoryCheck/recordDetail?infoId='+Infoid+'&storageId='+storageId);
   }


</script>
